<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue.js"></script>
	</head>
	<body>
		<div id="root">
			<!-- 遍历数组 -->
			<h2>人员信息</h2>
			<ul>
				<!-- <li v-for="p in persons" :key="p.id"> -->
				<li v-for="(p,index) of persons" :key="index">
					{{p.name}}-{{p.age}}
				</li>
			</ul>
			<!-- 遍历对象 -->
			<h2>手机型号</h2>
			<ul>
				<li v-for="(value,key) in phone" :key="key">
					{{key}}-{{value}}
				</li>
			</ul>
			<!-- 遍历字符串 -->
			<h2>遍历字符串</h2>
			<ul>
				<li v-for="(chr,index) in str" :key="index">
					{{chr}}-{{index}}
				</li>
			</ul>
			<!-- 遍历数字：指定次数 -->
		</div>
	</body>
	<script>
		new Vue({
			el:'#root',
			data(){
				return {
					persons:[
						{id:'001',name:'张三',age:12},
						{id:'002',name:'李四',age:13},
						{id:'003',name:'王五',age:14}
					],
					phone:{
						logo:'huawei',
						sign:'nova5',
						price:600
					},
					str:'孤帆远影碧空尽'
				}
			},
			methods:{
				
			}
		})
	</script>
</html>